x86: Use halt() macro instead of direct HLT asm.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 11 Sep 2007 10:21:44 +0000 (11:21 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 11 Sep 2007 10:21:44 +0000 (11:21 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/crash.c
xen/arch/x86/setup.c
xen/arch/x86/shutdown.c
xen/arch/x86/smp.c

index 398fd781d2c7d09160bcec573efc8cfb99d34587..831dc7e04dbad2da713f60a1db51ca62808f9e4c 100644 (file)
@@ -46,7 +46,7 @@ static int crash_nmi_callback(struct cpu_user_regs *regs, int cpu)
     hvm_cpu_down();
 
     for ( ; ; )
-        __asm__ __volatile__ ( "hlt" );
+        halt();
 
     return 1;
 }
index 99b752ac3822a338f910c3ce6b408a51c1e173bb..94b66e2950718a4350419c551335751cf2560fe5 100644 (file)
@@ -168,7 +168,7 @@ static void __init do_initcalls(void)
 
 #define EARLY_FAIL(f, a...) do {                \
     printk( f , ## a );                         \
-    for ( ; ; ) __asm__ __volatile__ ( "hlt" ); \
+    for ( ; ; ) halt();                         \
 } while (0)
 
 static unsigned long __initdata initial_images_start, initial_images_end;
index 7653dce4fd4988b16d59e5aca3987815675f8e41..c66c3fa019ce98c81a3a40476f38736cc387d884 100644 (file)
@@ -38,10 +38,11 @@ static inline void kb_wait(void)
             break;
 }
 
-static void  __attribute__((noreturn)) __machine_halt(void *unused)
+static void __attribute__((noreturn)) __machine_halt(void *unused)
 {
+    local_irq_disable();
     for ( ; ; )
-        __asm__ __volatile__ ( "hlt" );
+        halt();
 }
 
 void machine_halt(void)
@@ -213,7 +214,7 @@ void machine_restart(void)
         on_selected_cpus(cpumask_of_cpu(0), (void *)machine_restart,
                          NULL, 1, 0);
         for ( ; ; )
-            safe_halt();
+            halt();
     }
 
     smp_send_stop();
index 550faf069be443c745459be9b8a71432bb572419..660c26436f8ddfccbb9810f4437b16ac7eeb8ce4 100644 (file)
@@ -319,13 +319,15 @@ int on_selected_cpus(
 
 static void stop_this_cpu (void *dummy)
 {
+    ASSERT(!local_irq_is_enabled());
+
     disable_local_APIC();
     hvm_cpu_down();
 
     cpu_clear(smp_processor_id(), cpu_online_map);
 
     for ( ; ; )
-        __asm__ __volatile__ ( "hlt" );
+        halt();
 }
 
 /*